const express = require("express");
const router = express.Router();
let { findDB, addDB, delDB, updateDB } = require("../models/demo.js")

router.get("/findUser", async(req, res) => {
    let result = await findDB("demo");
    res.json(result)
})

router.get("/addUser", async(req, res) => {
    let result = await addDB("demo", req.query);
    res.send(result)
})
router.get("/delUser", async(req, res) => {
    let result = await delDB("demo", req.query);
    res.send(result)
})

router.get("/updateUser", async(req, res) => {
    let result = await updateDB("demo", req.query);
    res.send(result)
})



module.exports = router